public class Solution {
    public static int Add(int num1,int num2) {
        if(num2==0)
            return  num1;
        int sum=0;//个位相加，不包括进位
        int carry;//进位
        while(num2!=0){
            sum = num1^num2;
            carry = (num1&num2)<<1;
            num1 = sum;
            num2=carry;
        }
        return sum;
    }
    public static void main(String args[]){
        int b = Add(6,30);
        System.out.println(b);
    }
}

